procedure swap(var a,b:int64);
var t:int64;
begin
   t:=a;
   a:=b;
   b:=t;
end;
var
  x11,y11, x12, y12, x21, y21,x22, y22,s,xp1,yp1,xp2,yp2:int64;
  i:integer;
begin
 read(x11,y11, x12, y12, x21, y21,x22, y22);
 if x12<x11 then swap(x12, x11);
 if y12<y11 then swap(y12, y11);
 if x22<x21 then swap(x22, x21);
 if y22<y21 then swap(y22, y21);
 if x11>x21 then xp1:=x11 else xp1:=x21;
 if x12<x22 then xp2:=x12 else xp2:=x22;
 if y11>y21 then yp1:=y11 else yp1:=y21;
 if y12<y22 then yp2:=y12 else yp2:=y22;
 if (xp1<xp2) and (yp1<yp2) then
   writeln((xp2-xp1)*(yp2-yp1))
 else writeln(0);
end.